package com.x.crm.controller;


import com.alibaba.fastjson.JSON;
import com.x.crm.model.*;
import com.x.crm.model.VO.FollowInfoVO;
import com.x.crm.model.VO.IntentionVO;
import com.x.crm.rpc.IntentionModelRpcService;
import com.x.crm.rpc.IntentionRpcService;
import com.x.crm.util.Constant;
import com.x.framework.controller.BaseController;
import com.x.framework.controller.ResultCode;
import com.x.framework.controller.ResultModel;
import io.netty.util.internal.StringUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.config.annotation.Reference;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/customer")
public class IntentionInfoController extends BaseController {

	@Reference
	private IntentionRpcService intentionRpcService;

	@Reference
	private IntentionModelRpcService intentionModelRpcService;


	/**
	 * PC查询 销售商机列表
	 * @param intention
	 * @param customerShop
	 * @param customer
	 * @param intentionVO
	 * @return
	 */
	@RequestMapping(value = "/getOpportunityList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getOpportunityList(Intention intention, CustomerShop customerShop, Customer customer, IntentionVO intentionVO) {
		if (StringUtils.isEmpty(customerShop.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		customerShop.setCustomer(customer);
		intention.setCustomerShop(customerShop);
		intention.setIntentionVO(intentionVO);
		intention.setIsOpportunity(Constant.IS_OPPORTUNITY);
		List<Intention> opportunityList = intentionRpcService.getCustomerIntentionList(intention);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", opportunityList);
	}

	/**
	 * PC查询销售商机数量
	 * @param intention
	 * @param customerShop
	 * @param customer
	 * @param intentionVO
	 * @return
	 */
	@RequestMapping(value = "/getOpportunityNum", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getOpportunityNum(Intention intention, CustomerShop customerShop, Customer customer, IntentionVO intentionVO) {
		if (StringUtils.isEmpty(customerShop.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		customerShop.setCustomer(customer);
		intention.setCustomerShop(customerShop);
		intention.setIntentionVO(intentionVO);
		intention.setIsOpportunity(Constant.IS_OPPORTUNITY);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionRpcService.getCustomerIntentionNum(intention));
	}


	/**
	 * 过滤商机
	 * @param intention
	 * @return
	 */
	@RequestMapping(value = "/filterOpportunityOpr", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel filterOpportunityOpr(Intention intention ) {
		if (StringUtils.isEmpty(intention.getIntentionId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "意向ID不能为空");
		}
		if (StringUtils.isEmpty(intention.getCustomerShopId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "客户ID不能为空");
		}
		intention.setOpportunityState(Constant.OPPORTUNITY_YGL);
		intention.setIntentionState(Constant.INTENTION_YGL);
		intention.setOpportunityOprTime(this.getDate(0));
		CustomerShop customerShop = new CustomerShop();
		customerShop.setFollowState(Constant.CUSTOMER_INVALID);
		customerShop.setCustomerShopId(intention.getCustomerShopId());
		intention.setCustomerShop(customerShop);
		if (intentionRpcService.updateCustomerIntentionBasic(intention) == 0) {
			return new ResultModel(ResultCode.RESULT_FAIL, "更新失败");
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "更新成功");
	}





	/**
	 * App端客户意向列表
	 * @param intention
	 * @param intentionVO
	 * @return
	 */
	@RequestMapping(value = "/resForApp/getCustomerIntentionList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getCustomerIntentionList(Intention intention, IntentionVO intentionVO, CustomerShop customerShop ) {
		if (intentionVO.getIntentionOprType() == null ) {
			return new ResultModel(ResultCode.RESULT_FAIL, "操作来源不能为空");
		}
		if (StringUtils.isEmpty(intention.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		intention.setIntentionVO(intentionVO);
		intention.setCustomerShop(customerShop);
		List<Intention> intentionList = intentionRpcService.getCustomerIntentionList(intention);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionList);
	}

	/**
	 * 查看销售商机+跟进信息列表PC
	 * @param intention
	 * @return
	 */
	@RequestMapping(value = "/getCustomerIntentionListForPc", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getCustomerIntentionListForPc(Intention intention) {
		if (StringUtils.isEmpty(intention.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		if (intention.getIntentionState() == null) {
			return new ResultModel(ResultCode.RESULT_FAIL, "状态不能为空");
		}
		List<Intention> intentionList = intentionRpcService.getCustomerIntentionListForPc(intention);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionList);
	}

	/**
	 * 查看销售商机+跟进信息列表PC
	 * @param intention
	 * @return
	 */
	@RequestMapping(value = "/getCustomerIntentionNumForPc", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getCustomerIntentionNumForPc(Intention intention) {
		if (StringUtils.isEmpty(intention.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		if (intention.getIntentionState() == null) {
			return new ResultModel(ResultCode.RESULT_FAIL, "状态不能为空");
		}
		int res = intentionRpcService.getCustomerIntentionNumForPc(intention);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", res);
	}




	/**
	 * APP端客户意向列表数量
	 * @param intention
	 * @param intentionVO
	 * @return
	 */
	@RequestMapping(value = "/resForApp/getCustomerIntentionNum", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getCustomerIntentionNum(Intention intention, IntentionVO intentionVO , CustomerShop customerShop) {
		if (intentionVO.getIntentionOprType() == null ) {
			return new ResultModel(ResultCode.RESULT_FAIL, "操作来源不能为空");
		}
		if (StringUtils.isEmpty(intention.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		intention.setIntentionVO(intentionVO);
		intention.setCustomerShop(customerShop);
		int intentionNum = intentionRpcService.getCustomerIntentionNum(intention);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionNum);
	}



	/**
	 * APP端客户详情
	 * @param intention
	 * @return
	 */
	@RequestMapping(value = "/resForApp/getCustomerIntentionById", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getCustomerIntentionById(Intention intention ) {
		if (StringUtils.isEmpty(intention.getIntentionId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "意向ID不能为空");
		}
		if (StringUtils.isEmpty(intention.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		Intention intentionInfo= intentionRpcService.getCustomerIntentionById(intention);
		IntentionModel intentionModel = new IntentionModel();
		intentionModel.setIntentionId(intention.getIntentionId());
		List<IntentionModel> intentionModels = intentionModelRpcService.selectIntentionModelList(intentionModel);
		if (intentionInfo != null){
			intentionInfo.setIntentionModelList(intentionModels);
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionInfo);
	}




	/**
	 * 查询 销售商机列表
	 * @param intention
	 * @return
	 */
	@RequestMapping(value = "/resForApp/getOpportunityList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getOpportunityList(Intention intention, IntentionVO intentionVO) {
//		if (StringUtils.isEmpty(intention.getShopId())) {
//			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
//		}
		intention.setIsOpportunity(Constant.IS_OPPORTUNITY);
		intention.setIntentionVO(intentionVO);
		List<Intention> opportunityList = intentionRpcService.getCustomerIntentionList(intention);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", opportunityList);
	}

	/**
	 * 查询销售商机数量
	 * @param intention
	 * @return
	 */
	@RequestMapping(value = "/resForApp/getOpportunityNum", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getOpportunityNum(Intention intention, IntentionVO intentionVO) {
		if (StringUtils.isEmpty(intention.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		intention.setIsOpportunity(Constant.IS_OPPORTUNITY);
		intention.setIntentionVO(intentionVO);
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionRpcService.getCustomerIntentionNum(intention));
	}


	/**
	 * 工作台新分配待处理
	 * @param intention
	 * @return
	 */
	@RequestMapping(value = "/resForApp/dashboard", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel dashboard(Intention intention) {
		if (StringUtils.isEmpty(intention.getShopId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "店铺ID不能为空");
		}
		intention.setIntentionState(Constant.INTENTION_DGJ);
		Map<String, Object> res = new HashMap<>();
		res.put("xfpdcl", intentionRpcService.getCustomerIntentionNum(intention));
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", res);
	}




	/**
	 * 取消预订
	 * @param followOrder
	 * @return
	 */
	@RequestMapping(value = "/cancelFollowOrderOpr", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel cancelFollowOrderOpr(FollowOrder followOrder) {
		if (StringUtils.isEmpty(followOrder.getFollowOrderId())) {
			return new ResultModel(ResultCode.RESULT_FAIL, "预订信息ID不能为空");
		}
		followOrder.setOrderCarState(Constant.ORDER_CAR_INVALID_STATE);
		int res = intentionRpcService.updateFollowOrder(followOrder);
		if (res == 0){
			return new ResultModel(ResultCode.RESULT_FAIL, "更新失败");
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "更新成功");
	}



	/**
	 * 添加跟进信息
	 * @param intentionFollowState
	 * @param followInfoVO
	 * @return
	 */
	@RequestMapping(value = "/resForApp/insertIntentionFollowInfo", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel insertIntentionFollowInfo(Integer intentionFollowState, FollowInfoVO followInfoVO , String serviceList , String fixtureCarList, String orderCarList) {

		List<FixtureCar> fixtureCars = null ;
		List<OrderCar> orderCars = null ;
		List<FollowService> followServices = null ;
//		if (StringUtils.isEmpty(followInfoVO.getShopId())){
//			return new ResultModel(ResultCode.RESULT_FAIL, "商户ID不能为空");
//		}
		if (intentionFollowState == null ){
			return new ResultModel(ResultCode.RESULT_FAIL, "意向跟进资源不能为空");
		}
		if (StringUtils.isEmpty(followInfoVO.getIntentionId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "意向ID不能为空");
		}
		if (StringUtils.isNotEmpty(fixtureCarList)) {
			fixtureCars = JSON.parseArray(fixtureCarList, FixtureCar.class);
		}
		if (StringUtils.isNotEmpty(orderCarList)) {
			orderCars = JSON.parseArray(orderCarList, OrderCar.class);
		}
		if (StringUtils.isNotEmpty(serviceList)) {
			followServices = JSON.parseArray(serviceList, FollowService.class);
		}
		switch (intentionFollowState){
			case 20:
				FollowUp followUpInfo = followInfoVO.getFollowUp();
				followUpInfo.setUpCreateTime(this.getDate(0));
				followUpInfo.setUpUpdateTime(this.getDate(0));
				intentionRpcService.insertFollowUp(followUpInfo);
				break;
			case 30:
				FollowAppoint followAppointInfo = followInfoVO.getFollowAppoint();
				followAppointInfo.setAppointCreateTime(this.getDate(0));
				followAppointInfo.setAppointUpdateTime(this.getDate(0));
				intentionRpcService.insertFollowAppoint(followAppointInfo);
				break;
			case 40:
				FollowReach followReachInfo = followInfoVO.getFollowReach();
				followReachInfo.setReachCreateTime(this.getDate(0));
				followReachInfo.setReachUpdateTime(this.getDate(0));
				intentionRpcService.insertFollowReach(followReachInfo);
				break;
			case 50:
				FollowOrder followOrderInfo = followInfoVO.getFollowOrder();
				followOrderInfo.setFollowOrderCarList(orderCars);
				if (followServices.size() >0  && followServices.get(0) != null){
					followOrderInfo.setFollowServiceList(followServices);
				}
				followOrderInfo.setFollowOrderCreateTime(this.getDate(0));
				followOrderInfo.setFollowOrderUpdateTime(this.getDate(0));
				followOrderInfo.setOrderCarState(Constant.ORDER_CAR_VALID_STATE);
				intentionRpcService.insertFollowOrder(followOrderInfo);
				break;
			case 60:
				FollowFixture followFixtureInfo = followInfoVO.getFollowFixture() ;
				followFixtureInfo.setFollowFixtureCarList(fixtureCars);
				if (followServices.size() >0  && followServices.get(0) != null){
					followFixtureInfo.setFollowServiceList(followServices);
				}
				followFixtureInfo.setFollowFixtureCreateTime(this.getDate(0));
				followFixtureInfo.setFollowFixtureUpdateTime(this.getDate(0));
				intentionRpcService.insertFollowFixture(followFixtureInfo);
				break;
			case 70:
				FollowLose followLoseInfo = followInfoVO.getFollowLose();
				followLoseInfo.setLoseCreateTime(this.getDate(0));
				followLoseInfo.setLoseUpdateTime(this.getDate(0));
				intentionRpcService.insertFollowLose(followLoseInfo);
				break;
			default:
				break;
		}
		Intention  intention = new Intention();
		intention.setIntentionId(followInfoVO.getIntentionId());
		List<Intention>  intentionList = intentionRpcService.selectIntentionInfoList(intention);
		if (intentionList != null && intentionList.size() > 0 ){
			Intention intentionInfo = intentionList.get(0);
			intentionInfo.setIntentionState(intentionFollowState);
			intentionInfo.setLastOprTime(this.getDate(0));
			intentionRpcService.updateIntentionBasicInfo(intentionInfo);
		}else{
			return new ResultModel(ResultCode.RESULT_FAIL, "意向异常" );
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "新增成功" );
	}



	@RequestMapping(value = "/resForApp/getCustomerIntentionFollowList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getCustomerIntentionFollowList(Integer intentionFollowState , Intention intention) {
		if (StringUtils.isEmpty(intention.getShopId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "商户ID不能为空");
		}
		if (intentionFollowState == null ){
			return new ResultModel(ResultCode.RESULT_FAIL, "意向跟进资源不能为空");
		}
		if (StringUtils.isEmpty(intention.getIntentionId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "意向ID不能为空");
		}
		switch (intentionFollowState){
			case 20:
				FollowUp followUp = new FollowUp();
				followUp.setIntentionId(intention.getIntentionId());
				List<FollowUp> followUpList = intentionRpcService.selectFollowUpList(followUp);
				return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功",followUpList);
			case 30:
				FollowAppoint followAppoint = new FollowAppoint();
				followAppoint.setIntentionId(intention.getIntentionId());
				return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功",intentionRpcService.selectFollowAppointList(followAppoint));
			case 40:
				FollowReach followReach = new FollowReach();
				followReach.setIntentionId(intention.getIntentionId());
				return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功",intentionRpcService.selectFollowReachList(followReach));
			case 50:
				FollowOrder followOrder = new FollowOrder();
				followOrder.setIntentionId(intention.getIntentionId());
				followOrder.setOrderCarState(Constant.ORDER_CAR_VALID_STATE);
				List<FollowOrder> followOrderList = intentionRpcService.selectFollowOrderList(followOrder);
				for (FollowOrder  model:followOrderList){
					OrderCar orderCar = new OrderCar();
					orderCar.setFollowOrderId(model.getFollowOrderId());
					orderCar.setCarState(Constant.CAR_VALID_STATE);
					List<OrderCar> orderCarList = intentionRpcService.selectOrderCarList(orderCar);
					FollowService followService = new FollowService();
					followService.setFollowTypeId(model.getFollowOrderId());
					followService.setFollowType("followOrder");
					List<FollowService> servicesList = intentionRpcService.selectServiceList(followService);
					model.setFollowOrderCarList(orderCarList);
					model.setFollowServiceList(servicesList);
			    }
				return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", followOrderList);
			case 60:
				FollowFixture followFixture = new FollowFixture();
				followFixture.setIntentionId(intention.getIntentionId());
				List<FollowFixture> followFixtureList = intentionRpcService.selectFollowFixtureList(followFixture);
				for (FollowFixture  model:followFixtureList){
					FixtureCar fixtureCar = new FixtureCar();
					fixtureCar.setFollowFixtureId(model.getFollowFixtureId());
					fixtureCar.setCarState(Constant.CAR_VALID_STATE);
					List<FixtureCar> fixtureCarList = intentionRpcService.selectFixtureCarList(fixtureCar);
					FollowService followService = new FollowService();
					followService.setFollowTypeId(model.getFollowFixtureId());
					followService.setFollowType("followFixture");
					List<FollowService> servicesList = intentionRpcService.selectServiceList(followService);
					model.setFollowFixtureCarList(fixtureCarList);
					model.setFollowServiceList(servicesList);
				}
				return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", followFixtureList);
			case 70:
				FollowLose followLose = new FollowLose();
				followLose.setIntentionId(intention.getIntentionId());
				return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionRpcService.selectFollowLoseList(followLose));
			default:
				break;
		}
		return new ResultModel(ResultCode.RESULT_FAIL, "查询失败" );

	}



	@RequestMapping(value = "getOrderCarList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getOrderCarList(OrderCar orderCar) {
		if (StringUtils.isEmpty(orderCar.getFollowOrderId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "预订跟进信息ID不能为空");
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionRpcService.selectOrderCarList(orderCar));
	}


	@RequestMapping(value = "getFixtureCarList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getFixtureCarList(FixtureCar fixtureCar) {
		if (StringUtils.isEmpty(fixtureCar.getFollowFixtureId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "成交跟进信息ID不能为空");
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionRpcService.selectFixtureCarList(fixtureCar));
	}

	@RequestMapping(value = "getServiceList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getServiceList(FollowService followService) {
		if (StringUtils.isEmpty(followService.getFollowTypeId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "跟进信息ID不能为空");
		}
		if (StringUtils.isEmpty(followService.getFollowType())){
			return new ResultModel(ResultCode.RESULT_FAIL, "跟进信息类型不能为空");
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", intentionRpcService.selectServiceList(followService));
	}

	/**
	 * 预订时候成交
	 * @param followOrder
	 * @return
	 */
	@RequestMapping(value = "intentionFixtureOpr", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel intentionFixtureOpr(FollowOrder followOrder) {
		if (StringUtils.isEmpty(followOrder.getFollowOrderId())){
			return new ResultModel(ResultCode.RESULT_FAIL, "跟进预订ID不能为空");
		}
		List<FollowOrder>  followOrderList = intentionRpcService.selectFollowOrderList(followOrder);
		FollowOrder followOrderInfo = null;
		if (followOrderList !=null && followOrderList.size() > 0){
			followOrderInfo = followOrderList.get(0);
		}
		if (followOrderInfo != null ){
			FollowFixture followFixture = new FollowFixture();
			followFixture.setFixtureFollowerId(followOrderInfo.getOrderFollowerId());
			followFixture.setFixtureFollowerName(followOrderInfo.getOrderFollowerName());
			followFixture.setFixtureLevelId(followOrderInfo.getOrderLevelId());
			followFixture.setFixtureLevelTxt(followOrderInfo.getOrderLevelTxt());
			followFixture.setFixtureSaleMode(followOrderInfo.getOrderSaleMode());
			followFixture.setFixtureUserId(followOrderInfo.getOrderUserId());
			followFixture.setFixtureUserName(followOrderInfo.getOrderUserName());
			followFixture.setFixtureTime(this.getDate(0));
			followFixture.setFixturePrice(followOrderInfo.getOrderFixturePrice());
			followFixture.setFixtureOrderPrice(followOrderInfo.getOrderPrice());
			followFixture.setFixtureLogistics(followOrderInfo.getOrderLogistics());
			followFixture.setFixtureTradeMode(followOrderInfo.getOrderTradeMode());
			followFixture.setIntentionId(followOrderInfo.getIntentionId());
			followFixture.setFixtureFollowRemark(followOrderInfo.getOrderFollowRemark());
			followFixture.setFollowFixtureCreateTime(this.getDate(0));
			followFixture.setFollowFixtureUpdateTime(this.getDate(0));
			if (followOrderInfo.getFollowOrderCarList() !=null && followOrderInfo.getFollowOrderCarList().size() > 0){
				List<FixtureCar> fixtureCarList = new ArrayList<>();
				FixtureCar fixtureCar = null;
				for(OrderCar orderCar:followOrderInfo.getFollowOrderCarList()){
					fixtureCar = new FixtureCar();
					fixtureCar.setBrandId(orderCar.getBrandId());
					fixtureCar.setBrandName(orderCar.getBrandName());
					fixtureCar.setSeriesId(orderCar.getSeriesId());
					fixtureCar.setSeriesName(orderCar.getSeriesName());
					fixtureCar.setCarId(orderCar.getCarId());
					fixtureCar.setCarState(Constant.CAR_VALID_STATE);
					fixtureCar.setCarImageUrl(orderCar.getCarImageUrl());
					fixtureCar.setCarRetailPrice(orderCar.getCarRetailPrice());
					fixtureCar.setCarTitle(orderCar.getCarTitle());
					fixtureCarList.add(fixtureCar);
				}
				followFixture.setFollowFixtureCarList(fixtureCarList);
			}

			followFixture.setFollowServiceList(followOrderInfo.getFollowServiceList());
			intentionRpcService.insertFollowFixture(followFixture);
			Intention  intention = new Intention();
			intention.setIntentionId(followOrder.getIntentionId());
			intention.setIntentionState(Constant.INTENTION_YCJ);
			intention.setLastOprTime(this.getDate(0));
			intentionRpcService.updateIntentionBasicInfo(intention);
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "操作成功");
	}





}
